package com.zmn.oms.third.tmall.service;

import com.zmn.oms.common.exception.OmsBaseException;
import com.zmn.oms.model.entity.work.OrderWorkLogChange;
import com.zmn.oms.third.tmall.dto.TmallOrderCreateData;
import com.zmn.oms.third.tmall.dto.TmallOrderDataBase;
import com.zmn.oms.third.tmall.dto.TmallOrderReserveData;

/**
 * 天猫勤鸽渠道接入接口定义.
 *
 * @author xiewenbing
 * @date 2021/7/12
 */
public interface TmallService {

    /**
     * 根据时间段查询工单
     */
    void queryOrderByTime() throws OmsBaseException;

    /**
     * 创建订单
     * @param tmallOrderData
     * @throws OmsBaseException
     */
    Long createOrder(TmallOrderCreateData tmallOrderData) throws OmsBaseException;

    /**
     * 订单改约（渠道方）
     * @param tmallOrderReserveData
     * @throws OmsBaseException
     */
    void changeOrderDutytime(TmallOrderReserveData tmallOrderReserveData) throws OmsBaseException;

    /**
     * 订单取消（渠道方）
     * @param tmallOrderDataBase
     * @throws OmsBaseException
     */
    void cancelOrder(TmallOrderDataBase tmallOrderDataBase) throws OmsBaseException;

    /**
     * 订单核销完成（渠道方）
     * @param tmallOrderDataBase
     * @throws OmsBaseException
     */
    void completeOrder(TmallOrderDataBase tmallOrderDataBase) throws OmsBaseException;

    /**
     * 同步派单
     * @param orderWorkLogChange
     * @throws OmsBaseException
     */
    void syncOrderDistribute(OrderWorkLogChange orderWorkLogChange) throws OmsBaseException;

    /**
     * 同步预约
     * @param orderWorkLogChange
     * @throws OmsBaseException
     */
    void syncOrderDutytime(OrderWorkLogChange orderWorkLogChange) throws OmsBaseException;

    /**
     * 同步工单挂起
     * @param orderWorkLogChange
     * @throws OmsBaseException
     */
    void syncOrderSuspend(OrderWorkLogChange orderWorkLogChange) throws OmsBaseException;

    /**
     * 同步工单签到
     * @param orderWorkLogChange
     * @throws OmsBaseException
     */
    void syncOrderSignin(OrderWorkLogChange orderWorkLogChange) throws OmsBaseException;

    /**
     * 效验核销码
     *
     * @param orderId
     * @param vCode
     */
    void validateVerificationCode(Long orderId, String vCode) throws OmsBaseException;

    /**
     * 完成验证
     *
     * @param orderId
     * @param workId
     */
    boolean verifyComplete(Long orderId, Long workId);

    /**
     * 读取已校验的核销码
     * @param orderId
     * @return
     */
    String getVerificationCode(Long orderId) throws OmsBaseException;
}
